<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>
<HEAD>
   <TITLE>long pblKfFind</TITLE>
   <META NAME="GENERATOR" CONTENT="DOC++ 3.4.9">
</HEAD>
 <center>
<H2>Program Base Library Functions</H2>
</center>

<H2>long <A HREF="#DOC.DOCU">pblKfFind</A></H2><H2>( <!1><A HREF="pblKeyFile_t.html">pblKeyFile_t</A>*  k,   int mode,<BR>&nbsp;  unsigned char*  skey,   int skeylen,<BR>&nbsp;  unsigned char*  okey,   int*  okeylen )</H2><BLOCKQUOTE> find a record in a key file, set the current record</BLOCKQUOTE>

<A NAME="DOC.DOCU"></A>
<HR>
<H2>Documentation</H2>
<BLOCKQUOTE>
find a record in a key file, set the current record

<P>parameter mode specifies which record to find relative
to the search key specified by skey and skeylen.
the following values for mode are possible

<P><BR><B> PBLEQ </B> - find a record whose key is equal to skey
<BR><B> PBLFI </B> - find the first record that is equal
<BR><B> PBLLA </B> - find the last record that is equal
<BR><B> PBLGE </B> - find the last record that is equal or the smallest
record that is greater
<BR><B> PBLGT </B> - find the smallest record that is greater
<BR><B> PBLLE </B> - find the first record that is equal or the biggest
record that is smaller
<BR><B> PBLLT </B> - find the biggest record that is smaller

<P>keep in mind that PBL allows multiple records with the same key.

<P><P>
<B>RESTRICTIONS</B>:
<BR> - the out parameter okey must point to a memory area that is
big enough to hold any possible key, i.e 255 bytes

<P></BLOCKQUOTE>
<DL><DT><DT><B>Parameters:</B><DD><B>k</B> -   key file to search in                            
<BR><B>mode</B> -   mode to use for search                           
<BR><B>skey</B> -   key to use for search                            
<BR><B>skeylen</B> -   length of search key                             
<BR><B>okey</B> -   buffer for result key                            
<BR><B>okeylen</B> -   length of the result key after return            <BR><DT><B>Returns:</B><DD>  long rc >= 0:
<UL>
<LI>                  call went ok,
the value returned is the length
of the data of the record found,
<LI>                  the length of the key of the record is set in
the out parameter okeylen,
<LI>                  the key of the record is copied to okey,
<LI>                  the current record of the file is set to the
record found
</UL>
<BR>  long rc <  0:
<UL>
<LI>                  some error occured, see pbl_errno
especially PBL_ERROR_NOT_FOUND, if there is no 
matching record
</UL>
<BR><DD></DL><P><P><I><A HREF="index.html">Alphabetic index</A></I></P><HR>
<BR>
This page was generated with the help of <A HREF="http://docpp.sourceforge.net">DOC++</A>.
</BODY>
</HTML>
